import {$get, $post, $delete, $put, $postParms} from '@/utils/require'
import {UserApi} from "@/views/user/user.api";
export enum ExperimentApplicationCheckApi{
  list = "/admin/experimentApplication/list",
  selectLabs='/admin/experimentApplication/selectLabs',
  addLabSchedule='/admin/experimentApplication/addSchedule',
reject='/admin/experimentApplication/reject'
}

export const list = async (body?: any, params?: any) => {
  try {
    console.log("Api-body", body);
    console.log("Api-params", params);

    // 如果params不存在，则创建一个空对象
    if (!params) {
      params = {};
    }

    // 将body中的内容放入params
    Object.assign(params, body);
    return await $postParms(ExperimentApplicationCheckApi.list, undefined, params);

  } catch (error) {
    console.error(error);
  }
};

/**
 * 请求空闲的实验室
 */
export const selectLabs = async (body?: any, params?: any) => {
  try {
    console.log("Api-body", body);
    console.log("Api-params", params);
    // 如果params不存在，则创建一个空对象
    return await $postParms(ExperimentApplicationCheckApi.selectLabs, body, params);
  } catch (error) {
    console.error(error);
  }
};
/**
 * 插入排课表
 * @param body
 * @param params
 */
export const  addLabSchedule = async (body?: any, params?: any) => {
  try {
    console.log("Api-body", body);
    console.log("Api-params", params);
    // 如果params不存在，则创建一个空对象
    return await $postParms(ExperimentApplicationCheckApi.addLabSchedule, body, params);
  } catch (error) {
    console.error(error);
  }
};
/**
 * 驳回请求
 * @param body
 * @param params
 */
export  const rejectApp=async (body?: any, params?: any) => {
  try {
    console.log("Api-body", body);
    console.log("Api-params", params);
    // 如果params不存在，则创建一个空对象
    return await $postParms(ExperimentApplicationCheckApi.reject, body, params);
  } catch (error) {
    console.error(error);
  }
};